package hk.polyu;

import java.io.IOException;

/**
 * The abstract class for all index.
 * Two sub classes. InvertedIndex and DocumentIndex.
 * @author hezongjian
 *
 */
public interface Index {
	
	/**
	 * Save the index to a disk file
	 * @param path The path where the file will be save.
	 * @throws IOException
	 */
	public void save(String path) throws IOException;
	
	/**
	 * Load the index from a file.
	 * @param path The path where the index is stored.
	 * @throws IOException
	 */
	public void load(String path) throws IOException;
	
	/**
	 * Generate the index from the CollectionInfo.
	 * @param ci the collection information parsed from file.
	 */
	public void generate(CollectionInfo ci);

}
